package cn.tedu.review;
/**本类用于回顾封装的方法*/
public class TestStudent {
    public static void main(String[] args) {
        Student s1 = new Student();
        s1.setName("张三");
        s1.setSno(3);
        s1.setAddress("北京");
        System.out.println(s1.getName());
        System.out.println(s1.getSno());
        System.out.println(s1.getAddress());
        s1.eat();//通过调用公共方法来调用私有方法，因为他们是一个类里的
    }

}
class Student{
    private int sno;
    private String name;
    private String address;


    public int getSno() {
        return sno;
    }

    public void setSno(int sno) {
        this.sno = sno;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }
    private void study(){
        System.out.println("Good Good Study Day Day Up!");
    }
    public void eat(){
        System.out.println("啥也别说先干饭~");
        study();
    }



}
